package cs4280.jdbc;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class DB {
  public static DataSource getDataSource() throws NamingException {
    Context initCtx = new InitialContext();
    Context envCtx = (Context)initCtx.lookup("java:comp/env");
    return (DataSource)envCtx.lookup("jdbc/cinema");
  }
}
